{% extends "admin_form_base.jinja" %}
{% import 'macros.jinja' as macros %}

{%- block header_title -%}
{%- if token_fail -%}
    Broken link
{%- else -%}
        Change Password for
        {% if user.is_authenticated %}
            {{ user.email }}
        {% else %}
            {% if reset_user %}
            {{ reset_user.email }}
            {% endif %}
        {% endif %}
{% endif %}
{%- endblock header_title -%}
{% block form %}
    {% if token_fail %}
        <p>The password reset link was invalid, possibly because it has already been used.  Please request a <a href="{{ url('account_reset_password') }}">new password reset</a>.</p>
    {% else %}
        {% if form %}
            <form method="POST" action=".">
              {% include "includes/csrf_field.jinja" %}
                {{ macros.render_form_fields(form) }}
                <p>
                <input class="btn btn-lg btn-primary" type="submit" name="action" value="Change password"/>
                </p>
            </form>
        {% else %}
            <p>Your password is now changed.</p>
        {% endif %}
    {% endif %}
{% endblock form %}
